# Template file for 'delphinusdnsd'
pkgname=delphinusdnsd
version=1.7.3
revision=1
_delphinusdnsVersion=1_7_3
build_style=configure
configure_script="./configure"
conf_files="/etc/delphinusdns/delphinusdns.conf"
hostmakedepends="mk-configure bison"
makedepends="openssl-devel libbsd-devel libmd-devel libtls-devel"
short_desc="Delphinusdns is a small authoritative nameserver"
maintainer="MarcoAPC <marcoaureliopc@gmail.com>"
license="BSD-3-Clause"
homepage="https://delphinusdns.org"
distfiles="https://github.com/delphinusdns/${pkgname}/archive/RELEASE_${_delphinusdnsVersion}.tar.gz"
checksum=f4825d38a1c5030def1c7a867fc302f7656e434eadad83339db16d39f8d001f1
patch_args="-Np0"

system_accounts="_ddd"

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
	makedepends+=" musl-legacy-compat"
fi

do_install() {
	vbin dddctl/dddctl
	vbin delphinusdnsd/delphinusdnsd
	vmkdir etc/delphinusdns/
	vmkdir usr/share/examples/delphinusdnsd
	mv examples/Master/* ${DESTDIR}/usr/share/examples/delphinusdnsd
	mv examples/Replicant/* ${DESTDIR}/usr/share/examples/delphinusdnsd
	chmod 0644 ${DESTDIR}/usr/share/examples/delphinusdnsd/*
	vinstall delphinusdns.conf 0644 etc/delphinusdns/
	vman delphinusdns.conf.5
	vman delphinusdnsd.8
	vman dddctl.8
	sed -n '2,25p' < ddd-dns.h > LICENSE.BSD-3-Clause
	vlicense LICENSE.BSD-3-Clause
}
